package com.df.scenes.service;

import com.df.base.other.IGateWayStreamInterface;
import org.apache.dubbo.common.stream.StreamObserver;
import org.apache.dubbo.config.annotation.DubboService;

@DubboService(group = "${spring.application.name}",version = "${code.version}")
public class ScenesServerStreamProvider implements IGateWayStreamInterface {

    @Override
    public StreamObserver<Object> message(StreamObserver<Object> replyObserver) {

        return new StreamObserver<Object>() {
            @Override
            public void onNext(Object data) {
                System.out.println("收到-data:"+data);
                replyObserver.onNext("回复-data"+123);
            }

            @Override
            public void onError(Throwable throwable) {

            }

            @Override
            public void onCompleted() {

            }
        };
    }
}
